package com.ruoyi.cs.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.yyyoupin.bean.SaleResponse;
import com.ruoyi.cs.domain.TGoods;
import com.ruoyi.cs.domain.ZBTGoodsPoolVo;
import com.ruoyi.cs.domain.ZBTGoodsVo;
import com.ruoyi.cs.domain.vo.ChallengeTGoodsVo;
import com.ruoyi.cs.domain.vo.LuckyTGoodsVo;
import com.ruoyi.cs.domain.vo.TGoodsShoppingBackVo;
import com.ruoyi.cs.domain.vo.TGoodsVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.Cacheable;

/**
 * 饰品信息Mapper接口
 * 
 * @author ruoyi
 * @date 2021-03-25
 */
public interface TGoodsMapper 
{
    /**
     * 查询饰品信息
     * 
     * @param goodsId 饰品信息ID
     * @return 饰品信息
     */
    public TGoods selectTGoodsById(String goodsId);

    /**
     * 查询饰品信息列表
     * 
     * @param tGoods 饰品信息
     * @return 饰品信息集合
     */
    public List<TGoods> selectTGoodsList(TGoods tGoods);
    public List<TGoods> selectTGoodsListSz(TGoods tGoods);

    public List<Map> goodsChance(String boxId);

    public List<LuckyTGoodsVo> selectTGoodsListLuck(LuckyTGoodsVo tGoods);
    /**
     * 新增饰品信息
     * 
     * @param tGoods 饰品信息
     * @return 结果
     */
    public int insertTGoods(TGoods tGoods);


    /**
     * 修改饰品信息
     * 
     * @param tGoods 饰品信息
     * @return 结果
     */
    public int updateTGoods(TGoods tGoods);

    /**
     * 删除饰品信息
     * 
     * @param goodsId 饰品信息ID
     * @return 结果
     */
    public int deleteTGoodsById(String goodsId);

    /**
     * 批量删除饰品信息
     *
     * @param goodsIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteTGoodsByIds(String[] goodsIds);

    /**
     * 批量启用/停用饰品信息
     *
     * @param goodsIds 需要删除的数据ID
     * @return 结果
     */
    public int updateDelFlagTGoodsByIds(@Param("delFlag") String delFlag,@Param("goodsIds") String[] goodsIds);


    /**
     * 批量获取所属类型下对应ID的饰品数量
     * @param goodsBelongingType
     * @param goodsBelongingIds
     * @return
     */
    public int bacthTGoodsCount(@Param("delFlag")  String delFlag,@Param("goodsBelongingType")  String goodsBelongingType,@Param("goodsBelongingIds")  String[] goodsBelongingIds);

    /**
     * 统计可用的饰品
     * @param goodsBelongingType
     * @param goodsBelongingIds
     * @return
     */
    public int bacthTGoodsCountDelete(@Param("goodsBelongingType")  String goodsBelongingType,@Param("goodsBelongingIds")  String[] goodsBelongingIds);


    /**
     * 根据条件获取饰品信息列表
     * @param delFlag
     * @param goodsIds
     * @return
     */
    public  List<TGoods> bacthTGoodsList(@Param("delFlag")  String delFlag,@Param("goodsIds") String[] goodsIds);

    /**修改饰品库存数量*/
    public int updateTGoodsStockNum(TGoods tGoods);

    /**指定修改饰品库存数量*/
    public int updateTGoodsStockNumAppoint(TGoods tGoods);

    /**
     * 统计ROLL房间下各饰品的数量和总金额
     * @param goodsBelongingIds
     * @return
     */
    public List<Map> countGoodsNumAndPrice(@Param("goodsBelongingIds") List<String> goodsBelongingIds);


    /**
     * 查询饰品商城下的所有饰品列表信息
     * @param sortType 排序方式
     * @param minmoney 最小金额
     * @param maxmoney 最大金额
     * @return
     */
    public List<TGoods> shoppingList(@Param("sortType") String sortType,@Param("minmoney")String minmoney,@Param("maxmoney")String maxmoney);


    /**
     * 查询幸运饰品下的饰品列表信息
     * @param tGoodsVo
     * @return
     */
    public List<TGoods> luckyJewelryList(TGoodsVo tGoodsVo);

    /**
     * 赠送饰品列表
     * @return
     */
    public List<TGoods> giveGoodsList();

    /**
     * ROLL房 展示排名前三饰品图片名称
     * @param goodsBelongingId
     * @return
     */
    public List<Map> rollPicList3(String goodsBelongingId);


    public List<Map> batchRollPicList3(@Param("goodsBelongingIds") List<String> goodsBelongingIds);

    /**
     * 根据指定ROLL房ID 获取饰品信息列表
     * @param goodsBelongingId
     * @return
     */
    public List<TGoods> rollGoodsList(String goodsBelongingId);

    /**
     * 获取接近箱子价格的两个饰品信息
     * @param goodsBelongingId
     * @param boxPrice
     * @return
     */
    public List<TGoods> getRangeGoods(@Param("goodsBelongingId") String goodsBelongingId,@Param("boxPrice") String boxPrice);


    /**
     * 根据武器种类获取饰品名称列表
     * @param goodsMold
     * @return
     */
    public List<Map> goodsNameList(String goodsMold);

    /**
     * 获取箱子的饰品名称列表
     * @param goodsBelongingId
     * @return
     */
    public List<Map> goodsNameListTerm(String goodsBelongingId);

    /**
     * 后台饰品管理列表
     * @param tGoods
     * @return
     */
    public List<TGoods> goodsListBack(TGoods tGoods);

    /**
     * 修改库存状态
     * @param goodsId
     * @param goodsStockStatus
     * @return
     */
    public int updateTGoodsStockStatus(@Param("goodsId") String goodsId,@Param("goodsStockStatus") String goodsStockStatus);


    public List<TGoods> boxGoodsList(@Param("goodsBelongingType") String goodsBelongingType,@Param("goodsBelongingId") String goodsBelongingId);


    public List<TGoods> boxGoodsList1(@Param("goodsBelongingType") String goodsBelongingType,@Param("goodsBelongingId") String goodsBelongingId);


    public List<TGoods> selectboxGoodsList(@Param("goodsBelongingIds") List<String> goodsBelongingIds);

    public List<TGoods> boxGoodsListBack(@Param("goodsBelongingType") String goodsBelongingType,@Param("goodsBelongingId") String goodsBelongingId);


    public List<TGoods> boxGoodsListBack1(@Param("goodsBelongingType") String goodsBelongingType,@Param("goodsBelongingId") String goodsBelongingId);



    public int floorsSection(@Param("minPrice") String minPrice,@Param("maxPrice")  String maxPrice);

    public int floorsSectionBygoodsId(@Param("minPrice") String minPrice,@Param("maxPrice")  String maxPrice,@Param("goodsId") String goodsId);

    public int goodsPremiumSet(@Param("type") String type,@Param("val") String val);

    public List<TGoods> floorsGoodsList(String goodsPrice);

    public List<TGoods> lowBoxGoodsList(@Param("boxId") String boxId,@Param("boxPrice") String boxPrice);

    public List<TGoods> lowestPriceGoods(@Param("boxId") String boxId);

    public List<TGoods> highBoxGoodsList(@Param("boxId") String boxId,@Param("boxPrice") String boxPrice);

    public List<TGoods> battleFloorsGoodsList(String goodsPrice);

    public int floorsSectionBattle(@Param("minPrice") String minPrice,@Param("maxPrice")  String maxPrice);


    public int floorsSectionBygoodsIdBattle(@Param("minPrice") String minPrice,@Param("maxPrice")  String maxPrice,@Param("goodsId") String goodsId);


    public List<TGoods> shoppingMallList(TGoodsVo tGoodsVo);

    public  List<TGoodsShoppingBackVo> shoppingMallListBack(TGoodsShoppingBackVo tGoodsShoppingBackVo);

    /**
     * 获取箱子中价格最高的一件饰品
     * @param goodsBelongingType
     * @param goodsBelongingId
     * @return
     */
    /*@Cacheable(value="battleListCache", key="'boxGoodsMaxPrice_belongType_'+#p0+'_belongId  _'+#p1")*/
    public TGoods boxGoodsMaxPrice(@Param("goodsBelongingType") String goodsBelongingType,@Param("goodsBelongingId")  String goodsBelongingId);


    public List<TGoods> getMarketHashNameAll(@Param("type") String type, @Param("boxIds") List<String> boxIds);

    public int updateTGoodPrice(@Param("type") String type, @Param("list") List<ZBTGoodsVo> list, @Param("boxId") String boxId,@Param("stocknum")int stocknum);

    public int updateTGoodPriceYY(@Param("type") String type, @Param("list") List<SaleResponse> list, @Param("boxId") String boxId, @Param("stocknum")int stocknum);


    public List<String> getGoodsTopN(@Param("boxId") String boxId, @Param("frontJackpotNum") Integer frontJackpotNum);


    /**
     * 查询价格区间的饰品列表
     *
     * @param minPrice
     * @param maxPrice
     * @param goodsBelongingId
     * @param goodsBelongingType
     * @return
     */
    public List<TGoods> selectPriceRangeGoods(@Param("minPrice") String minPrice,
                                   @Param("maxPrice") String maxPrice,
                                   @Param("goodsBelongingId") String goodsBelongingId,
                                   @Param("goodsBelongingType") String goodsBelongingType);

    /**
     * 查询箱子饰品金额大于指定金额的一个饰品
     *
     * @param goodsPrice
     * @return
     */
    public TGoods selectLessThanPriceGoods(@Param("goodsPrice") String goodsPrice,
                                           @Param("goodsBelongingId") String goodsBelongingId);


    public int copyBoxTGoods(@Param("newBelongingId") String newBelongingId,@Param("oldBelongingId") String oldBelongingId);

    public List<Map> checkBoxGoodsExit(@Param(value = "boxIds") String[] boxIds);

    /**
     * 更新未查到的饰品信息
     * @param list
     * @return
     */
    public int updateTGoodNotExist(@Param("list") List<TGoods> list);

    /**
     * 修改幸运饰品溢价值
     * @param premiumRate
     * @param goodsbelongingtype
     * @return
     */
    public int updatePremiumRate(@Param("premiumRate") String premiumRate,
                                 @Param("goodsbelongingtype") String goodsbelongingtype);


    /**
     * 批量更新饰品品级
     * @param list
     * @return
     */
    public int updateGrateBatch(@Param("list")  List<TGoods> list);


    /**
     * 保底算法的箱子饰品
     * @param boxId
     * @return
     */
    public List<TGoods> getBDSFGoods(String boxId);


    /**
     * 批量查询排雷饰品列表
     * @param goodsIds
     * @return
     */
    public  List<ChallengeTGoodsVo> bacthQueryMineClearTGoodsList(@Param("goodsIds") String[] goodsIds);

    /**
     * 获取所有的全名挑战饰品
     * @return
     */
    @Cacheable(value="twoMinuteCache", key="'queryAllMineClearTGoodsList'")
    public List<ChallengeTGoodsVo> queryAllMineClearTGoodsList();

    /**
     * @Desc: 批量更新饰品的roll值区间
     */
    public int updateRollValueRangeBatch(List<TGoods> list);

    /**
     * @Desc: 批量获取箱子下的所有饰品
     */
    public List<TGoods> battleBoxGoods(@Param("boxIds")List<String> boxIds);


    /**
     * @Desc: 批量查询饰品
     */
    public List<TGoods> batchQueryByIds(@Param("goodsIds")List<String> goodsIds);

    /**
     * @Desc: 更新盲盒内的饰品价格
     * @author: zz
     * @date: 2024/2/5
     */
    public int updateBoxGoodsPrice();

    /**
     * @Desc: 更新幸运饰品和商城内的饰品
     * @author: zz
     * @date: 2024/2/5
     */
    public int updateMaxAndLuckGoodsPrice();


    /**
     * @Desc: 更新未上限的ROLL房的饰品价格
     * @author: zz
     * @date: 2024/2/5
     */
    public int updateRollGoodsPrice();

}
